package flc.ast.adapter;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import flc.ast.R;
import flc.ast.bean.MyUnitBean;
import flc.ast.bean.QzdBean;
import stark.common.basic.adaptermutil.StkProviderMultiAdapter;

public class MyUnitAdapter extends StkProviderMultiAdapter<MyUnitBean> {


    public MyUnitAdapter() {
        addItemProvider(new MyUnitProvider());
    }

    private class MyUnitProvider extends BaseItemProvider<MyUnitBean> {
        @Override
        public int getItemViewType() {
            return StkProviderMultiAdapter.TYPE_VIEW;
        }

        @Override
        public int getLayoutId() {
            return R.layout.item_qzd;
        }

        @Override
        public void convert(@NonNull BaseViewHolder baseViewHolder, MyUnitBean bean) {
            baseViewHolder.setText(R.id.tvQzdItem,bean.getCnName()+"（"+bean.getEnName()+"）");
            if (bean.isSelect()) {
                baseViewHolder.setImageResource(R.id.ivQzdSelect, R.drawable.xz1);
            } else {
                baseViewHolder.setImageResource(R.id.ivQzdSelect, R.drawable.wxz1);
            }
        }
    }

}
